#include <windows.h>
#include "simcrypt.h"


#define XOR	^



void simplecrypt(unsigned char bKey,unsigned char *plain,unsigned char *cryptout,unsigned int nsize)
{

	unsigned int i;
	
	//unsigned char tmp = 0 ;


	for (i=0;i<nsize;i++)
	{
		  
		cryptout[i] =  LOBYTE((plain[i] XOR 0xFF) XOR bKey) ;

	}

	return;
}



void simple_decrypt(unsigned char bKey,unsigned char *cryptbuf,unsigned char *plainout,unsigned int nsize)
{
	
	unsigned int i;
	
	
	
	for (i=0;i<nsize;i++)
	{

				
		plainout[i] = LOBYTE((cryptbuf[i] XOR 0xFF) XOR bKey) ;
				
	}
	
	return;
}


